/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.events;

import org.json.simple.JSONObject;

import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.GUIDStorage;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.pawn.GenericPawn;


/**
 * @author Massimo Canonaco
 *
 */
public class InvalidPointSettingEvent implements GenericEvent 
{

	/** */
	static private final int NO_SET = -1;
	
	/**It's the row value. */
	private int row;
	
	/**It's the column value. */
	private int column;
	
	/**True means the source point in invalid. False means the target point is invalid. */
	private boolean invalidSource;
	
	/** */
	public InvalidPointSettingEvent(final boolean source, final int row, final int column)
	{
		this.row = row;
		this.column = column;
		
		invalidSource = source;
		
	}
	
	/** */
	public InvalidPointSettingEvent(final boolean source)
	{
		invalidSource = source;
		row = column = NO_SET;
	}
	
	/** */ 
	static public final float GUID = GUIDStorage.INVALID_POINT_SETTING_EVENT;
	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.events.GenericEvent#getGUID()
	 */
	@Override
	public float getGUID() {
		return GUID;
	}

	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.events.GenericEvent#getName()
	 */
	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @return the invalidSource
	 */
	public boolean isInvalidSource() {
		return invalidSource;
	}

	/**
	 * @return the row
	 */
	public int getRow() {
		return row;
	}

	/**
	 * @return the column
	 */
	public int getColumn() {
		return column;
	}
	
	/** */
	public boolean isPointSet()
	{
		return row == NO_SET || column == NO_SET;
	}

	@Override
	public JSONObject getAsJSONObject() 
	{
		return null;
	}

	@Override
	public void setFromJSONOnbject(JSONObject object) 
	{
		
	}

}
